#include "dialog.h"

Dialog::Dialog(QWidget* p):QDialog(p) {
    QVBoxLayout* layout = new QVBoxLayout(this);
    this->setLayout(layout);
    QLabel* label = new QLabel("这是一个对话框",this);
    QPushButton* button = new QPushButton("关闭",this);
    layout->addWidget(label);
    layout->addWidget(button);
    connect(button,&QPushButton::clicked,this,&Dialog::handle);
}

void Dialog::handle(){
    this -> close();
}
